<html>
<!-- $LastChangedDate: 2009-11-07 22:56:33 -0500 (Sat, 07 Nov 2009) $ -->
<!-- Copyright (C) 2004,2009 Jim Brooks http://www.palomino3d.org -->
<head>
<title>Palomino - Shadow Module</title>
<link rel='stylesheet' type='text/css' href='docs.css'>
<link rel='icon' type='image/png' href='images/favicon.png'/>
</head>
<body>

<!-- ----------------------------------------------------------------------- -->
<h1>Palomino - Shadow Module</h1>
<p>
&copy;2004,2009&nbsp;&nbsp;Jim E. Brooks
&nbsp;&nbsp;<a href='http://www.palomino3d.org'>http://www.palomino3d.org</a>
</p>
<hr>
<ul>
  <li><a href='index.html'>Index</a></li>
  <li><a href='#Overview'>Overview</a></li>
</ul>

<!-- ----------------------------------------------------------------------- -->
<hr>
<a name='Overview'></a>
<h2>Overview</h2>
<p><!--date-->[2009/05]</p>
<a name='ShadowSceneGraph'></a>
<h3>Shadow Scene-Graph</h3>
<p>
The class <code>ShadowSceneGraph</code> is a facade over
the shadow algorithm implementation (osgShadow::MinimalShadowMap).
ShadowSceneGraph is itself a private implementation of
<a href='module_graph.html#SceneGraph'>SceneGraph</a>
which encompasses the entire scene-graph.
ShadowSceneGraph forms a separate graph containing
objects which either cast or receive shadows.
</p>
<h3>Scene-Graph Arrangement</h3>
<p>
<a href='module_graph.html#NodeSort'>NodeSort</a>
defines whether an object is a shadow caster or receiver.
<code>SceneGraph::AttachObject(Object,NodeSort)</code>
is the interface for attaching nodes.
SceneGraph will detect thru NodeSort if a node is a shadow caster/receiver,
and defer such nodes to ShadowSceneGraph.
</p>
<pre>
osgShadow::ShadowedScene -> ShadowSceneGraph::mShadowRootNode -> shadowCasters
                                                                 shadowReceivers

The reason for this arrangement is to override
the stock OSG shaders attached to osgShadow::ShadowedScene.
</pre>
<h3>Shadow Casters/Receivers</h3>
<p>
Disabling casting shadows for parts of a 3D model
can be done by calling ShadowSceneGraph::DisableShadows(Node).
An example is jet exhaust which shouldn't cast shadows.
</p>
<p><i>
The current implementation, osgShadow::MinimalShadowMap, will malfunction
if multiple shadow casters exist.
ShadowSceneGraph will ignore NodeSort=SHADOW_CASTER if one already exists.
</i></p>
<h3>Shaders for Rendering Shadows</h3>
<p>
As it has the same BaseSceneGraph class as
<a href='module_graph.html#SceneGraph'>SceneGraph</a>,
ShadowSceneGraph maintains <i>branch nodes</i> containing shaders determined by NodeSort.
The shaders will render shadows if <code>uni_shadowMode</code> is set.
<code>uni_shadowMode</code> can be assigned <code>UNI_SHADOW_SAMPLE1</code>
or <code>UNI_SHADOW_SAMPLE4</code> for super-sampling
which produces <quote>soft shadows</quote>.
</p>

<!-- ********************************* END ********************************* -->
<hr>
<p align='center'>
<font size='-2'>
<!-- hhmts start -->
Last modified: Sat Nov  7 14:58:05 CST 2009
<!-- hhmts end -->
</font>
</p>

</body>
</html>
